/*
* 新增建筑公司
* 宁建浩
* */
var testConfig = require('../testConfig');
var testDatas = require('../testData');
function TestProject() {
  this.init = function () {
    var arr = [];
    arr.push(this.step1,
      this.step2,
      this.step3,
      this.step4,
      this.step5,
      this.step6,
      this.step7,
      this.step8,
      this.step9,
      this.step10,
      this.step11,
      this.step12,
      this.step13,
      this.step14,
      this.step15,
      this.step16,
      this.step17,
      this.step18,
      this.step19,
      this.step20,
      this.step21,
      this.step22,
      this.step23,
      this.step24,
      this.step25,
      this.step26,
      this.step27,
      this.step28,
      this.step29,
      this.step30,
      this.step31);
    testConfig.testFun.runStep(arr);
  };
  this.step1 = function () {
    $("#aside-nav").find("div.coords").eq(1).find("a")[0].click();
  };
  this.step2 = function () {
    $("#collapse2").find("li:nth-child(2) .second_lv_li")[0].click();
  };
  this.step3 = function () {
    testConfig.testFun.ai().find('.addTeamBtn')[0].click();
  };
  this.step4 = function () {
    testConfig.testFun.ai().find('.addTeamBtn').siblings("ul").find("li:nth-child(1) a")[0].click();
  };
  this.step5 = function () {
    testConfig.testFun.ai().find("input[data-name='companyName']").val(testDatas.testFun.company);
  };
  this.step6 = function () {
    testConfig.testFun.ai().find("input[data-name='companyShortname']").val(testDatas.testFun.shortCompany);
  };
  this.step7 = function () {
    testConfig.testFun.ai().find("input[data-name='registrationNum']").val(testDatas.testFun.registrationNum);
  };
  this.step8 = function () {
    testConfig.testFun.ai().find("#img_idd").attr('src', testDatas.testFun.imgOrganizationCode);
  };
  this.step9 = function () {
    testConfig.testFun.ai().find("input[data-name='organizationCode']").val(testDatas.testFun.organizationCode);
  };
  this.step10 = function () {
    testConfig.testFun.ai().find("#img_ide").attr('src', testDatas.testFun.imgBusiness);
  };
  this.step11 = function () {
    testConfig.testFun.ai().find("input[data-name='businessTaxNum']").val(testDatas.testFun.businessTaxNum);
  };
  this.step12 = function () {
    testConfig.testFun.ai().find("#province").attr({
      'my-name': '江西省',
      'my-id': '360000'
    }).find("option").eq(14).attr("selected", true);
  };
  this.step13 = function () {
    testConfig.testFun.ai().find("#city").attr({
      'my-name': '抚州市',
      'my-id': '361000'
    }).html("<option value='361000' selected>抚州市</option>");
  };
  this.step14 = function () {
    testConfig.testFun.ai().find("input[data-name='companyAddress']").val('江西省南丰县琴城镇');
  };
  this.step15 = function () {
    testConfig.testFun.ai().find("[data-name='businessScope']").val(testDatas.testFun.businessScope).focus();
  };
  this.step16 = function () {
    testConfig.testFun.ai().find(".company-time")[0].click();
  };
  this.step17 = function () {
    testConfig.testFun.ai().find("input[data-name='phoneNumber']").val(testDatas.testFun.phone);
  };
  this.step18 = function () {
    testConfig.testFun.ai().find("input[data-name='companyLegal']").val(testDatas.testFun.legal);
  };
  this.step19 = function () {
    testConfig.testFun.ai().find("input[data-name='contactIdcard']").val(testDatas.testFun.idCard);
  };
  this.step20 = function () {
    testConfig.testFun.ai().find(".card-time")[0].click();
  };
  this.step21 = function () {
    testConfig.testFun.ai().find("#img_idb").attr('src', testDatas.testFun.imgFront);
  };
  this.step22 = function () {
    testConfig.testFun.ai().find("#img_idc").attr('src', testDatas.testFun.imgBack);
  };
  this.step23 = function () {
    testConfig.testFun.ai().find("#save_btn")[0].click();
  };
  this.step24 = function () {
    testConfig.testFun.ai().find("input[data-name='userName']").val(testDatas.testFun.companyUserName);
  };
  this.step25 = function () {
    testConfig.testFun.ai().find("input[data-name='phone']").val(testDatas.testFun.accountPhone);
  };
  this.step26 = function () {
    testConfig.testFun.ai().find("input[data-name='email']").val(testDatas.testFun.accountEmail);
  };
  this.step27 = function () {
    testConfig.testFun.ai().find("#AcceQuery")[0].click();
  };
  this.step28 = function () {
    testConfig.testFun.ai().find("#nextStep_btn")[0].click();
  };
  this.step29 = function () {
    testConfig.testFun.ai().find("#complete")[0].click();
  };
  this.step30 = function () {
    testConfig.testFun.ai().find("input[data-name='companyName']").val(testDatas.testFun.company);
  };
  this.step31 = function () {
    testConfig.testFun.ai().find("#confirm")[0].click();
  }
}
function testStart() {
  var test = new TestProject();
  test.init();
}
exports.start = testStart;